package com.shop.util;


import java.io.Serializable;


public class Result<T> implements Serializable {

    //业务码，比如成功、失败、权限不足等 code，可自行定义
    private int status;
    //数据结果，泛型，可以是列表、单个对象、数字、布尔值等
    private T data;

    public Result() {
    }

    public Result(int status, Object data) {
        this.status = status;
        this.data = (T) data;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }



    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "Result{" +
                "status=" + status +
                ", data=" + data +
                '}';
    }
}
